using CustomerContactSystem.Core.Infrastructure.Domain;

namespace CustomerContactSystem.Core.Model {
    public class EnquiryCategory : Entity {
        public virtual Department Department { get; set; }
        public virtual string CategoryName { get; set; }
        public virtual bool AvailableForSelection { get; set; }

        protected override void Validate() {
            if (Department == null || Department.Id == 0) {
                AddBrokenRule(new BusinessRule("Department", "Please select a department!"));
            }

            if (string.IsNullOrEmpty(CategoryName)) {
                AddBrokenRule(new BusinessRule("CategoryName", "Category name is required!"));
            }
        }
    }
}